package com.clz.workorder.fragment

import com.alibaba.android.arouter.facade.annotation.Route
import com.clz.workorder.databinding.FragmentServiceScoreBinding
import com.clz.workorder.viewmodel.ServiceScoreViewModel
import com.clz.workorder.BR
import com.clz.workorder.R
import com.czl.base.base.BaseFragment
import com.czl.base.config.AppConstants
import com.czl.base.event.LiveBusCenter

/**
 *
 * @Description:服务评分
 * @Author: XCH
 * @CreateDate: 2021/12/10 11:27
 */
@Route(path = AppConstants.Router.Report.F_SERVICE_SCORE)
class ServiceScoreFragment : BaseFragment<FragmentServiceScoreBinding, ServiceScoreViewModel>() {
    override fun initContentView(): Int {
        return R.layout.fragment_service_score
    }

    override fun initVariableId(): Int {
        return BR.viewModel
    }

    override fun initData() {
        viewModel.tvTitle.set("服务评分")
        if (arguments != null) {
            viewModel.no =
                requireArguments().getString(AppConstants.BundleKey.WORK_ORDER_NO, "")
        }
    }

    override fun initViewObservable() {
        viewModel.uc.evaluateCompleteEvent.observe(this, {
            LiveBusCenter.postScoreCompleteEvent()
            back()
        })
    }
}